﻿$('a').live('click', function (e) {
    var target = $(e.target);
    var parent = target.parent();
    if (parent.is('div') && parent.hasClass('pressable')) {
        var li = target.closest('div.pressable');
        li.siblings().find('div.dropdown').hide();
        li.find('div.dropdown').toggle();
        e.preventDefault();
    }
})

$(document).click(function (e) {
    var target = $(e.target);
    if (target.closest('#nav').length < 1) {
        var nav = $('#nav');
        nav.find('div.dropdown').hide();
    }
});

$(document).ready(function () {
    var nav = $('#nav');
    nav.find('div.dropdown').hide();
});

function overlay() {
    el = document.getElementById("FiltersDialog");
    el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}